
#ifndef PROCESS_H
#define PROCESS_H
#include <QMutex>
#include <QObject>
#include <QSet>
#include <QRunnable>
#include <QThread>
#include <QWaitCondition>
#include <QString>
#include <QFile>
#include <QList>
#include <QPair>
#include <windows.h>
#include <wtsapi32.h>
#include <Psapi.h>
class Process : public QObject, public QRunnable {
    Q_OBJECT
private:
    QString processName;
    QString dllPath;
    QWaitCondition *cond;
    QMutex *mutex;
public:
    explicit Process(QObject *parent = nullptr);
    // 获取所有进程名及其进程 ID，并发送信号
    bool EnumerateProcesses(WTS_PROCESS_INFOW *&processInfo, DWORD &processCount);
    bool isSystemService(DWORD pid);
protected:
    void run();
signals:
    void SendDra(const QString message);
    void SendProcesses(const QList<QPair<QString, DWORD>> processes);
};
#endif
